
public class Distance {
    double x, y, z;

    public Distance(double _x, double _y, double _z) {
        x = _x;
        y = _y;
        z = _z;
    }

    public double getDistance(Distance p) {
        return Math.sqrt((x - p.x) * (x - p.x) + (y - p.y) * (y - p.y) + (z - p.z) * (z - p.z));
    }
}

class Test {
    public static void main(String[] args) {
        Distance p = new Distance(2.0, 3.0, 6.0);
        Distance origin = new Distance(0.0, 0.0, 0.0);
        System.out.println(p.getDistance(origin));
    }
}
